Imports System.Xml.Serialization
Namespace Mapping

    Public Class EntityTypeModificationFunction
        Inherits XEntityModelElementBase

        ''' <summary>Initializes an instance of the <see cref="EntityTypeModificationFunction" /> class.</summary>
        ''' <param name="localName">The name of the new element.</param>
        Public Sub New(ByVal localName As String)
            MyBase.New(localName, CSXmlNamespace)
            ValidateLocalName(localName, New String() {"InsertFunction", "DeleteFunction", "UpdateFunction"})
        End Sub

        ''' <summary>Initializes an instance of the <see cref="EntityTypeModificationFunction" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __ScalarProperties As FunctionMappingScalarPropertyCollection
        Private __ComplexProperties As FunctionMappingComplexPropertyCollection
        Private __AssociationEnds As FunctionMappingAssociationEndCollection

        <AutoLoad()> _
        <XmlElement("ComplexProperty", GetType(FunctionMappingComplexProperty))> _
        Public ReadOnly Property ComplexProperties() As FunctionMappingComplexPropertyCollection
            Get
                If (__ComplexProperties Is Nothing) Then
                    __ComplexProperties = New EdmxEditor.Mapping.FunctionMappingComplexPropertyCollection(Me, MyBase.Name.Namespace, "ComplexProperty")
                End If
                Return __ComplexProperties
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("ScalarProperty", GetType(FunctionMappingScalarProperty))> _
        Public ReadOnly Property ScalarProperties() As FunctionMappingScalarPropertyCollection
            Get
                If (__ScalarProperties Is Nothing) Then
                    __ScalarProperties = New EdmxEditor.Mapping.FunctionMappingScalarPropertyCollection(Me, MyBase.Name.Namespace, "ScalarProperty")
                End If
                Return __ScalarProperties
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("AssociationEnd", GetType(FunctionMappingAssociationEnd))> _
        Public ReadOnly Property AssociationEnds() As FunctionMappingAssociationEndCollection
            Get
                If (__AssociationEnds Is Nothing) Then
                    __AssociationEnds = New EdmxEditor.Mapping.FunctionMappingAssociationEndCollection(Me, MyBase.Name.Namespace, "AssociationEnd")
                End If
                Return __AssociationEnds
            End Get
        End Property

        <XmlAttribute()> _
        Public Property FunctionName() As String
            Get
                Return Me.@FunctionName
            End Get
            Set(ByVal value As String)
                Me.@FunctionName = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property RowsAffectedParameter() As String
            Get
                Return Me.@RowsAffectedParameter
            End Get
            Set(ByVal value As String)
                Me.@RowsAffectedParameter = value
            End Set
        End Property

    End Class

End Namespace